<template>
	<view class="ShopList">
		<view class="list">
			<view class="item" v-for="(item,index) in shoplist" :key="index">
				<view class="left">
					<image :src="item.img | getImg" mode="widthFix"></image>
					<view class="info">
						<view class="title">
							{{item.shop_name}}
						</view>
						<view class="phone">
							商家手机号：{{item.phone}}
						</view>
						<view class="phone">
							本月销毁YSB：{{item.burn}}
						</view>
					</view>
				</view>
				<view class="right" @click="toDetail(item.user_id)">
					<text>查看详情</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		ShopTeam
	} from "@/api/user.js"
	export default {
		data() {
			return {
				shoplist: []
			}
		},
		onLoad() {
			this.ShopTeam()
		},
		methods: {
			ShopTeam() {
				ShopTeam().then(res => {
					this.shoplist = res.data
				})
			},
			toDetail(id) {
				uni.navigateTo({
					url: 'detail/detail?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss">
	.list {
		border-top: 1px solid #d3d3d3;
	}

	.item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 10px;
		border-bottom: 1px solid #d3d3d3;
		font-size: 14px;

		.left {
			display: flex;
			align-items: center;

			image {
				width: 50px;
				border-radius: 50%;
				height: 50px;
			}

			.info {
				padding-left: 8px;

				.title {
					font-size: 14px;
				}

				.phone {
					font-size: 12px;
					color: #2f2f2f;
				}
			}
		}

		.right {
			text {
				border: 1px solid #d3d3d3;
				padding: 5px;
				border-radius: 5px;
			}
		}
	}
</style>